﻿using System;

namespace enyo
{
    public class BasicPopup : LazyControl
    {
        public bool Modal { get; set; }
        public bool DismissWithClick { get; set; }
        public bool DismissWithEscape { get; set; }
        public bool ShareScrim { get; set; }
        public bool ScrimWhenModal { get; set; }
        public bool Scrim { get; set; }
        public string ScrimClassName { get; set; }
        public bool AutoClose { get; set; }

        /// <summary>
        /// Event fired right before the popup is opened. 
        /// If the popup's contained components are created lazily, they will be ready at this time. 
        /// By handling this event, it's possible to affect popup contents before the popup is displayed.
        /// </summary>
        //TODO:inFirstOpen {Boolean} Flag indicating if this is the first time the popup has opened.
        public EnyoEvent<Control, bool> onBeforeOpen;

        /// <summary>
        /// Event fired after the popup has been opened.
        /// </summary>
        public EnyoEvent<Control> onOpen;

        /// <summary>
        /// Event fired after the popup is closed.
        /// </summary>
        //TODO:inEvent {Event} (optional) event that triggered the close. inReason {String} (optional) reason the popup was closed.
        public EnyoEvent<Control, object, string> onClose;

        /// <summary>
        /// Closes the popup. The reason argument describes why the popup was closed. 
        /// Any control inside a popup that has a popupHandler property will close the popup when clicked and will pass the value of popupHandler as the reason the popup was closed. In addition, the popup can be closed automatically in some cases and will pass a message of the form "popup:reason" in this case. 
        /// For example, when a popup is open and is destroyed, it is closed with the reason "popup:destroyed."
        /// </summary>
        /// <param name="evtArg">Event that triggered the close.</param>
        /// <param name="reason">Reason that this popup closed.</param>
        public void Close(object evtArg, string reason)
        {
        }

        /// <summary>
        /// Opens the popup in its current position.
        /// </summary>
        public void Open()
        {
        }

        /// <summary>
        /// If the popup is open, closes it; otherwise, opens it.
        /// </summary>
        public void ToggleOpen()
        {
        }
    }
}
